CLASSPATH This part is largely a whiteboard discussion. Normally we put the .class files in the same directory as the .java files. You can send the .class files to another directory if you want to keep them separate (javac -d dir *.java) src and build directories If all .java files are in the same directory, you can compile them all in one shot using javac *.java. If your source is distributed across multiple directories, you'll need to run javac *.java in each directory. The problem is that the classes in the different directories may depend on each other. If class A depends on class B, and they're in different directories, you have to compile B's directory before you compile A's directory. To compile A.java, the compiler needs access to B.class to get information that it needs. To make this work, you have to tell the compiler where to find .class files. javac -classpath {classdir} *.java The compiler already knows where to find the .class files for the built-in classes, so you don't have to tell it. Similarly, when you run a Java program, you might need to tell the virtual machine where to find your .class files. (This is only necessary if you run the program from a different directory than the one containing the .class files.) java -classpath {classdir} MainClass PACKAGES As programs grow in size, we can't store all source code in a single directory. Organize code in a folder hierarchy, putting related classes into the same directory. These groups of related classes are called PACKAGES. ORGANIZE LIBRARY CODE INTO FOLDERS The package structure is also reflected in the source code. MODIFY LIBRARY FILES TO INCLUDE PACKAGE DECLARATIONS COMPILE EACH PACKAGE USING CLASSPATHS SHOW CONTENTS OF BUILD DIRECTORY RUN MODIFIED LIBRARY EXAMPLE You can use the same folder hierarchy to store both .java and .class files, but often they are kept separate. Whichever you do, there is still a distinction between source files and class files, even if they're in the same directory.